package org.theqcp.wow.sim.gui.tabs;

import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;

import org.theqcp.wow.sim.gui.DataPoint;
import org.theqcp.wow.sim.gui.EnhSimGUIFrame;

public class Enhancement extends DataPanel {

    private static final long serialVersionUID = 6876050514695626868L;

    protected final String[] Enchants = new String[] { "-", "Berserking", "Crusader", "Deathfrost", "Executioner",
	    "Mongoose" };
    protected final String[] Glyphs = new String[] { "-", "Earth Shock", "Flametongue Weapon", "Flame Shock", "Lava",
	    "Lava Lash", "Lightning Bolt", "Lightning Shield", "Stormstrike", "Water Mastery", "Windfury Weapon" };
    protected final String[] Imbues = new String[] { "-", "Flametongue", "Windfury" };
    protected final String[] Metagems = new String[] { "-", "Chaotic Skyfire Diamond", "Chaotic Skyflare Diamond",
	    "Ember Skyflare Diamond", "Relentless Earthsiege Diamond", "Relentless Earthstorm Diamond",
	    "Thundering Skyfire Diamond" };
    protected final String[] SetBonus = new String[] { "-", "cyclone_harness", "cataclysm_harness",
	    "desolation_battlegear", "gladiators_earthshaker", "skyshatter_harness_2", "skyshatter_harness_4",
	    "skyshatter_regalia_2", "skyshatter_regalia_4", "naxx_melee_2", "naxx_melee_4", "naxx_nuker_2",
	    "naxx_nuker_4" };
    protected final String[] Totems = new String[] { "-", "Deadly Gladiators Totem of Indomitability",
	    "Hateful Gladiators Totem of Indomitability", "Savage Gladiators Totem of Indomitability",
	    "Deadly Gladiators Totem of Survival", "Hateful Gladiators Totem of Survival",
	    "Savage Gladiators Totem of Survival", "Skycall Totem", "Stonebreakers Totem", "Totem of Dueling",
	    "Totem of Hex", "Totem of Splintering", "Totem of Ancestral Guidance", "Totem of the Astral Winds",
	    "Totem of the Elemental Plane", "Totem of the Void" };
    protected final String[] Trinkets = new String[] { "-", "Abacus of Violent Odds", "Ashtongue Talisman",
	    "Badge of Tenacity", "Bandits Insignia", "Berserkers Call", "Blackened Naaru Sliver", "Bloodlust Brooch",
	    "Darkmoon Card Crusade", "Darkmoon Card Greatness", "Dragonspine Trophy", "Dying Curse",
	    "Embrace of the Spider", "Fezziks Pocketwatch", "Forge Ember", "Fury of the FiveFlights", "Grim Toll",
	    "Hourglass of the Unraveller", "Illustration of the DragonSoul", "Incisor Fragment", "Loathebs Shadow",
	    "Madness of the Betrayer", "Mark of Norgannon", "Mark of the War Prisoner", "Meteorite Whetstone",
	    "Mirror of Truth", "Pendulum of Telluric Currents", "Rune of Finite Variation", "Shadowsong Panther",
	    "Shard of Contempt", "Sphere of Red Dragons Blood", "Sundial of the Exiled", "The Skull of Guldan",
	    "Thorny Rose Brooch", "Tome of Arcane Phenomena", "Tsunami Talisman", "Twilight Serpent",
	    "Vestige of Haldor" };

    public Enhancement(EnhSimGUIFrame esgFrame) {
	fieldNames.put("MH Enchant", DataPoint.mh_enchant);
	fieldNames.put("MH Imbue", DataPoint.mh_imbue);
	fieldNames.put("OH Enchant", DataPoint.oh_enchant);
	fieldNames.put("OH Imbue", DataPoint.oh_imbue);
	fieldNames.put("Trinket 1", DataPoint.trinket1);
	fieldNames.put("Trinket 2", DataPoint.trinket2);
	fieldNames.put("Totem", DataPoint.totem);

	fieldNames.put("Set bonus", DataPoint.set_bonus);
	fieldNames.put("Metagem", DataPoint.metagem);

	fieldNames.put("Major 1", DataPoint.glyph_major1);
	fieldNames.put("Major 2", DataPoint.glyph_major2);
	fieldNames.put("Major 3", DataPoint.glyph_major3);
	fieldNames.put("Minor 1", DataPoint.glyph_minor1);
	fieldNames.put("Minor 2", DataPoint.glyph_minor2);
	fieldNames.put("Minor 3", DataPoint.glyph_minor3);

	setupFrame(esgFrame);
    }

    private void setupFrame( EnhSimGUIFrame esgFrame ) {
	{
	    JPanel p = new JPanel();
	    add(p);
	    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	    p.setBorder(new TitledBorder("Main hand"));

	    p.add(makeComboBox(esgFrame, "MH Enchant", Enchants));
	    p.add(makeComboBox(esgFrame, "MH Imbue", Imbues));
	}

	{
	    JPanel p = new JPanel();
	    add(p);
	    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	    p.setBorder(new TitledBorder("Off hand"));

	    p.add(makeComboBox(esgFrame, "OH Enchant", Enchants));
	    p.add(makeComboBox(esgFrame, "OH Imbue", Imbues));
	}

	{
	    JPanel p = new JPanel();
	    add(p);
	    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	    p.setBorder(new TitledBorder("Trinkets"));

	    p.add(makeComboBox(esgFrame, "Trinket 1", Trinkets));
	    p.add(makeComboBox(esgFrame, "Trinket 2", Trinkets));
	}

	this.add(makeComboBox(esgFrame, "Totem", Totems));
	this.add(makeComboBox(esgFrame, "Set bonus", SetBonus));
	this.add(makeComboBox(esgFrame, "Metagem", Metagems));

	{
	    JPanel p = new JPanel();
	    add(p);
	    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	    p.setBorder(new TitledBorder("Major Glyphs"));

	    p.add(makeComboBox(esgFrame, "Major 1", Glyphs));
	    p.add(makeComboBox(esgFrame, "Major 2", Glyphs));
	    p.add(makeComboBox(esgFrame, "Major 3", Glyphs));
	}

	{
	    JPanel p = new JPanel();
	    add(p);
	    p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));
	    p.setBorder(new TitledBorder("Minor Glyphs"));

	    p.add(makeComboBox(esgFrame, "Minor 1", "-"));
	    p.add(makeComboBox(esgFrame, "Minor 2", "-"));
	    p.add(makeComboBox(esgFrame, "Minor 3", "-"));
	}
    }
}
